﻿using SD.Infrastructure.EntityBase;
using System;

namespace SlamDunk.MES.Domain.Entities.QualityContext
{
    /// <summary>
    /// 质量检查明细
    /// </summary>
    public class QualityInspectionDetail : PlainEntity, ISortable
    {
        #region # 构造器

        #region 00.无参构造器
        /// <summary>
        /// 无参构造器
        /// </summary>
        protected QualityInspectionDetail() { }
        #endregion

        #region 01.创建质量检查明细构造器
        /// <summary>
        /// 创建质量检查明细构造器
        /// </summary>
        /// <param name="productId">产品Id</param>
        /// <param name="productionQuantity">生产数量</param>
        /// <param name="qualifiedQuantity">合格数量</param>
        /// <param name="sampleQuantity">样品数量</param>
        /// <param name="manhour">人员工时</param>
        /// <param name="machinehour">设备台时</param>
        /// <param name="sort">排序</param>
        /// <param name="description">描述</param>
        public QualityInspectionDetail(Guid productId, decimal productionQuantity, decimal qualifiedQuantity, decimal sampleQuantity, decimal? manhour, decimal? machinehour, int sort, string description)
            : this()
        {
            this.ProductId = productId;
            this.ProductionQuantity = productionQuantity;
            this.QualifiedQuantity = qualifiedQuantity;
            this.SampleQuantity = sampleQuantity;
            this.Manhour = manhour;
            this.Machinehour = machinehour;
            this.Sort = sort;
            this.Description = description;
        }
        #endregion

        #endregion

        #region # 属性

        #region 产品Id —— Guid ProductId
        /// <summary>
        /// 产品Id
        /// </summary>
        public Guid ProductId { get; private set; }
        #endregion

        #region 生产数量 —— decimal ProductionQuantity
        /// <summary>
        /// 生产数量
        /// </summary>
        public decimal ProductionQuantity { get; private set; }
        #endregion

        #region 合格数量 —— decimal QualifiedQuantity
        /// <summary>
        /// 合格数量
        /// </summary>
        public decimal QualifiedQuantity { get; private set; }
        #endregion

        #region 样品数量 —— decimal SampleQuantity
        /// <summary>
        /// 样品数量
        /// </summary>
        public decimal SampleQuantity { get; private set; }
        #endregion

        #region 人员工时 —— decimal? Manhour
        /// <summary>
        /// 人员工时
        /// </summary>
        public decimal? Manhour { get; private set; }
        #endregion

        #region 设备台时 —— decimal? Machinehour
        /// <summary>
        /// 设备台时
        /// </summary>
        public decimal? Machinehour { get; private set; }
        #endregion

        #region 排序 —— int Sort
        /// <summary>
        /// 排序
        /// </summary>
        public int Sort { get; private set; }
        #endregion

        #region 描述 —— string Description
        /// <summary>
        /// 描述
        /// </summary>
        public string Description { get; private set; }
        #endregion

        #region 导航属性 - 质量检查 —— QualityInspection QualityInspection
        /// <summary>
        /// 导航属性 - 质量检查
        /// </summary>
        public virtual QualityInspection QualityInspection { get; internal set; }
        #endregion

        #endregion
    }
}
